package com.rede.didiok.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.common.dto.user.UserDto;
import com.rede.didiok.common.utils.ResultUtil;
import com.rede.didiok.user.service.CreditsLogService;

// import org.apache.shiro.authz.annotation.RequiresPermissions;



/**
 * 获取/消耗积分日志表
 *
 * @author Rede
 * @email didiok@foxmail.com
 * @date 2023-08-07 18:21:17
 */
@RestController
@RequestMapping("user/feign/creditslog")
public class CreditsLogController {
    @Autowired
    private CreditsLogService creditsLogService;

    /**
     * 查询用户获取积分情况
     * 该接口为了解决 用户积分获取异常问题
     * 获取数据 包括
     * 签到数据
     * 博客数据
     * 问答数据
     * 评论数据
     *
     * @param userDto
     * @return
     */
    @PostMapping("/user/feign/user/queryCredits")
    String queryCredits(@RequestBody UserDto userDto){
        return ResultUtil.successWithData(creditsLogService.queryCredits(userDto));
    }
}
